<?php


namespace app\cms\admin\controller\merchant;

use app\cms\model\merchant\merchantLicenseModel;
use iflow\Response;
use iflow\Router\Controller;
use iflow\Router\implement\Request\{ GetMapping, PostMapping };

#[Controller('%cmsAdmin%/merchant_license')]
class merchantLicense
{
    #[GetMapping]
    public function get(
        // 商户id
        int $merchant_id,
        // 许可id
        string $merchant_license_id,
        // 许可类型
        int $license_type,
        // 许可审核状态
        int $license_review_type,
        // 商户名称
        string $merchant_name = ""
    ): Response {
        return (new merchantLicenseModel()) -> licenseList(
            $merchant_id,
            $merchant_license_id,
            $license_type,
            $license_review_type,
            $merchant_name
        );
    }


    /**
     * 审核 商户许可
     * @param int $merchant_id
     * @param int $merchant_license_id
     * @param int $license_review_type
     * @param string $license_review_desc
     * @return Response
     */
    #[PostMapping]
    public function reviewMerchantLicense(
        int $merchant_id,
        int $merchant_license_id,
        int $license_review_type,
        string $license_review_desc
    ): Response {
        return (new merchantLicenseModel()) -> reviewMerchantLicense(
            $merchant_id,
            $merchant_license_id,
            $license_review_type,
            $license_review_desc
        );
    }
}